<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('新增会员商品')}" />
</head>
<body class="hold-transition">
<div class="container-fluid mt-2 mb-2">
        <form class="form-horizontal m" id="form-sale-add">
            <div class="form-group row" style="margin-top: 30px">
                <label class="col-sm-2 col-form-label is-required text-sm-right">商品名称</label>
                <div class="col-sm-6">
                    <input name="name" placeholder="请输入商品名称" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label is-required text-sm-right">类型</label>
                <div class="col-sm-4">
                    <select name="typeId" class="form-control m-b" th:with="type=${memberType}">
                        <option th:each="dict : ${type}" th:text="${dict.title}" th:value="${dict.id}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label is-required text-sm-right">价格</label>
                <div class="col-sm-4">
                    <input name="price" placeholder="请输入商品价格" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label is-required text-sm-right">开通天数</label>
                <div class="col-sm-4">
                    <input name="days" placeholder="请输入天数" class="form-control" value="1" type="number">
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-sm-right">排序</label>
                <div class="col-sm-4">
                    <input name="sort" placeholder="排序"  class="form-control" value="0" type="number">
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-sm-right">描述</label>
                <div class="col-sm-8">
                    <textarea style="min-height: 100px" name="description" placeholder="商品描述" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:insert="~{include :: footer}" />
    <script type="text/javascript">
        $("#form-sale-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save("/member/sale/save.json", $('#form-sale-add').serialize());
            }
        }
    </script>
</body>
</html>